/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package supportlearning.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Huy
 */
@Embeddable
public class StudentResultPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "StudentId", nullable = false, length = 50)
    private String studentId;
    @Basic(optional = false)
    @Column(name = "AsmId", nullable = false)
    private int asmId;

    public StudentResultPK() {
    }

    public StudentResultPK(String studentId, int asmId) {
        this.studentId = studentId;
        this.asmId = asmId;
    }

    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public int getAsmId() {
        return asmId;
    }

    public void setAsmId(int asmId) {
        this.asmId = asmId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (studentId != null ? studentId.hashCode() : 0);
        hash += (int) asmId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StudentResultPK)) {
            return false;
        }
        StudentResultPK other = (StudentResultPK) object;
        if ((this.studentId == null && other.studentId != null) || (this.studentId != null && !this.studentId.equals(other.studentId))) {
            return false;
        }
        if (this.asmId != other.asmId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "supportlearning.entities.StudentResultPK[studentId=" + studentId + ", asmId=" + asmId + "]";
    }

}
